import unittest


def setUpModule():
    print('test module start >>>>>')


def tearDownModule():
    print('test module end >>>>>')


class MyTest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        print('test class start___')

    @classmethod
    def tearDownClass(cls):
        print('test class end ____')

    def setUp(self):
        pass

    def tearDown(self):
        pass

    @unittest.skip('直接跳过测试')
    def test_skip(self):
        print('test aaa')

    @unittest.skipIf(3 > 2, '为True跳过测试')
    def test_skip_if(self):
        print('test bbb')

    @unittest.skipUnless(3 > 2, '为True执行测试')
    def test_skip_unless(self):
        print('test ccc')

    # 不管结果是否失败，都标记为失败
    @unittest.expectedFailure
    def test_expected_failure(self):
        self.assertEqual(2, 2)


if __name__ == '__main__':
    unittest.main()
